package com.ap.core.domain.sequence.generation;

/**
 * Abstraction for the Id generation service.
 * 
 * 
 * @param <ID>
 *            Type of the Id object that is generated.
 */
public interface MultiIdGenerationService<ID> {

    /**
     * Get the next available Id.
     * 
     * @param qualifier
     *            Qualifier name for the sequence.
     * @return Returns the next available Id.
     * @throws IdGenerationException
     *             In case of an unexpected exception.
     */
    ID getNextId(final String qualifier) throws IdGenerationException;

    /**
     * Get the next available Id.
     * 
     * @param qualifier
     *            Qualifier name for the sequence.
     * @return Returns the next available Id.
     * @throws IdGenerationException
     *             In case of an unexpected exception.
     */
    ID getNextId(final Class<?> qualifier) throws IdGenerationException;

    /**
     * Resets the id.
     * 
     * @param qualifier
     *            Qualifier name for the sequence.
     */
    void reset(final String qualifier);

    /**
     * Resets the id.
     * 
     * @param qualifier
     *            Qualifier name for the sequence.
     */
    void reset(final Class<?> qualifier);

}
